﻿@{
    ViewData["Title"] = "实物档案检索";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section head{
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet" />
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" />
    <link href="/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
    <link href="/css/animate.min.css" rel="stylesheet" />
    <link href="/css/style.min.css?v=4.1.0" rel="stylesheet" />
    <style type="text/css">
        #toolbar {
            margin-top: 10px;
        }

        .dSearch .btn {
            margin-top: -3px;
        }

        .dSearch .form-control {
            display: inline-block;
        }

        .dataTables_wrapper {
            padding-bottom: 0px;
        }

        div.dataTables_scrollBody table {
            margin-top: -18px !important;
        }

        .fixed-table-pagination .pagination-detail, .fixed-table-pagination div.pagination {
            margin-bottom: 0px;
        }

        #dSearch table tr td {
            padding: 8px;
        }

        #dSearch .input-group {
            width: 100%;
            margin-bottom: 16px;
        }

        #dSearch .input-group-addon {
            width: 100px;
        }

        #dSearch .fix-border {
            border-left: none;
            border-right: none;
        }
    </style>
}

<form id="form1" runat="server">
    <div id="dMain">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="ibox" style="margin-bottom: 0px;">
                <div class="ibox-title">
                    <h5>实物档案-<%=Title() %></h5>
                    <div class="ibox-tools">
                        <a class="btn btn-primary btn-circle btn-outline" title="刷新" href="javascript:location.href=location.href;" style="margin-top: -7px;"><i class=" fa fa-refresh"></i></a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="dSearch dSearcha">
                        <asp:TextBox ID="txtFileNo" runat="server" CssClass="form-control" placeholder="档号" Width="120"></asp:TextBox>
                        <asp:DropDownList ID="dllType" runat="server" CssClass="form-control" placeholder="实物类型" Width="100"></asp:DropDownList>
                        <asp:DropDownList ID="ddlFTerm" runat="server" CssClass="form-control" Width="100"></asp:DropDownList>
                        <asp:TextBox ID="txtAY" runat="server" CssClass="form-control" placeholder="题名" Width="200"></asp:TextBox>
                        <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn btn-sm btn-primary" OnClick="lbtnSearch_Click"><i class="icon-search"></i>&nbsp;快速检索</asp:LinkButton>
                        <a id="ShowSearch" class="btn btn-sm btn-primary" onclick="ShowDivOfPage('#myModal','综合检索',500,510)"><i class="icon-search"></i>&nbsp;综合检索</a>
                        <asp:LinkButton ID="lbtnAll" runat="server" CssClass="btn btn-sm btn-primary" OnClick="lbtnAll_Click"><i class="icon-table"></i>&nbsp;查看全部</asp:LinkButton>
                    </div>
                    <div id="toolbar" class="dSearch">
                    </div>
                    <table id="tabData" class="table table-bordered" style="width: 1800px;">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>档号</th>
                                <th>实体分类号</th>
                                <%--
                                <th>第一责任者</th>--%>
                                <th>题名</th>
                                <th>归档年度</th>
                                <th>保管期限</th>
                                <th>件号</th>
                                <%--
                                <th>案卷号</th>--%>
                                <th>目录号</th>
                                <th>形成时间</th>
                                <th>备注</th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div id="myModal" style="display: none;">
        <div id="dSearch" class="modal-body" style="height: 415px;">
            <div class="input-group">
                <span class="input-group-addon">档号</span>
                <asp:TextBox ID="txtDH" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">目录号</span>
                <asp:TextBox ID="txtMLH" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <%--<div class="input-group" style="display: none;">
                <span class="input-group-addon">第一责任者</span>
                <asp:TextBox ID="txtBlamer1" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group" style="display: none;">
                <span class="input-group-addon">第二责任者</span>
                <asp:TextBox ID="txtBlamer2" runat="server" CssClass="form-control"></asp:TextBox>
            </div>--%>
            <div class="input-group">
                <span class="input-group-addon">实物说明</span>
                <asp:TextBox ID="txtRealExp" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">形成时间</span>
                <asp:TextBox ID="txtFormDate1" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyyMMdd',errDealMode:3})"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtFormDate2" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyyMMdd',errDealMode:3})"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">密级</span>
                <asp:DropDownList ID="ddlSecretLevel" runat="server" CssClass="form-control"></asp:DropDownList>
            </div>
            <div class="input-group">
                <span class="input-group-addon">保管期限</span>
                <asp:DropDownList ID="ddlTerm" runat="server" CssClass="form-control"></asp:DropDownList>
            </div>
            <%--<div class="input-group">
                <span class="input-group-addon">案卷号</span>
                <asp:TextBox ID="txtAJH1" runat="server" CssClass="form-control" dataType="zzs" Msg="案卷号格式不正确!"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtAJH2" runat="server" CssClass="form-control" dataType="zzs" Msg="案卷号格式不正确!"></asp:TextBox>
            </div>--%>
            <div class="input-group">
                <span class="input-group-addon">归档年度</span>
                <asp:TextBox ID="txtReturnYear1" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyy'})"></asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;">至</span>
                <asp:TextBox ID="txtReturnYear2" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyy'})"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">载体类型</span>
                <asp:DropDownList ID="ddlCarrierType" runat="server" CssClass="form-control"></asp:DropDownList>
            </div>
            <div class="input-group">
                <span class="input-group-addon">载体数量</span>
                <asp:TextBox ID="txtCarrierNum" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon">全宗号</span>
                <asp:TextBox ID="txtQZH" runat="server" CssClass="form-control"></asp:TextBox>
                <%--<span class="input-group-addon fix-border fix-padding" style="width: 50px;">案卷号</span>
                <asp:TextBox ID="txtAJH" runat="server" CssClass="form-control"></asp:TextBox>--%>
            </div>
            <div class="input-group" style="margin-bottom: 0px;">
                <span class="input-group-addon">备注</span>
                <asp:TextBox ID="txtRemark" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
        </div>
        <div class="modal-footer">
            <asp:Button ID="btnSearch" runat="server" CssClass="btn btn-primary btn-sm" OnClientClick="return verfic('tip', '#dSearch');" OnClick="btnSearch_Click" Text="检索" />
            <input id="btnClose" type="button" class="btn btn-default btn-sm" value="取消" onclick="CloseDiv()" />
        </div>
    </div>
    <input id="hfLogInfo" type="hidden" value="删除了一条数据" />
    <input id="hfModular" type="hidden" value="实物档案" />
    <input id="hfPageUrl" type="hidden" value="<%=Request.Url.PathAndQuery %>" />
</form>
@section scripts{
    <script src="/js/jquery.min.js?v=2.1.4"></script>
    <script src="/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/js/plugins/jeditable/jquery.jeditable.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table-export.js"></script>
    <script src="/js/plugins/bootstrap-table/tableExport.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table-cookie.js"></script>
    <script src="/js/My97DatePicker/WdatePicker.js"></script>
    <script src="/js/plugins/layer/layer.min.js"></script>
    <script src="/js/verification.js"></script>
    <script src="/js/store.js"></script>
    <script src="/js/zuiCode.js"></script>


    <script type="text/javascript">
        $(function () {
            var tabWidth = $("#tabData").width();//初始宽度
            var tabHeight = document.documentElement.clientHeight - 130;
            $('#tabData').bootstrapTable({
                height: tabHeight,
                data: $("#dJson").text() != "" ? JSON.parse($("#dJson").text()) : "",
                dataType: "json",
                sortName: 'ItemNo',
                columns: [
                    { align: 'center', width: "50px", checkbox: true },
                    { field: 'DH', align: 'center', width: "150px", sortable: true },
                    { field: 'STFLH', align: 'center', width: "100px", sortable: true },
                    //{ field: 'Blamer1', align: 'left', width: "180px", sortable: true,visible: false },
                    { field: 'RealExp', align: 'left', width: "300px" },
                    { field: 'ReturnYear', align: 'center', width: "100px", sortable: true },
                    { field: 'Term', align: 'center', width: "100px", sortable: true },
                    { field: 'ItemNo', align: 'center', width: "80px", sortable: true },
                    //{ field: 'AJH', align: 'center', width: "80px", sortable: true ,visible: false},
                    { field: 'MLH', align: 'center', width: "80px", sortable: true },
                    { field: 'FormDate', align: 'center', width: "100px", sortable: true },
                    { field: 'Remark', align: 'left', width: "250px" },
                ],
                toolbar: '#toolbar',//工具按钮用哪个容器
                buttonsClass: "sm btn-white",//按钮class
                pageSize: 100,//分页条数
                clickToSelect: true,//设置true将在点击行时，自动选择单选或复选框
                singleSelect: false,//为true则禁止多选
                cache: false,//是否缓存
                cookie: true,//是否启用cookie
                cookieIdTable: "Real",//cookie键值
                pagination: true,//是否分页
                showColumns: true,//是否显示所有的列
                showRefresh: true,//是否显示刷新按钮
                search: true,//是否启用搜索
                showPaginationSwitch: true,//是否显示分页切换按钮
                showExport: true,//是否启用导出
                striped: false,//是否显示行间隔色
                onDblClickRow: function (row, obj) { //双击行事件
                    location.href = "ImageSon.aspx?ParentID=" + (row.ID);
                },
                onSearch: function (text) {
                    if (text != "") {
                        $("#tabData tbody tr").each(function (z) {
                            $("td:not(.bs-checkbox)", this).each(function (i) {
                                if (i != 0) {
                                    var str = "<span class=\"bg-yellow\">" + text + "</span>";
                                    var NewText = $("#tabData tbody tr").eq(z).find("td").eq(i).text().replaceAll(text, str);
                                    $("#tabData tbody tr").eq(z).find("td").eq(i).html(NewText);
                                }
                            })
                        })
                    }
                }
            });
        })
    </script>
}
